﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Colorful.Furniture.PermissionManagement
{
    /// <summary>
    /// 机构输出体
    /// </summary>
    public class OrganizationDto
    {
        /// <summary>
        /// 编码
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 父级编码
        /// </summary>
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        public string ChargePerson { get; set; }

        /// <summary>
        /// 代码
        /// </summary>
        
        public string Code { get; set; }

        /// <summary>
        /// 是否禁用
        /// </summary>
        
        public bool IsDisabled { get; set; }

        /// <summary>
        /// 是否门店
        /// </summary>
        
        public bool IsStore { get; set; }

        /// <summary>
        /// 层级代码
        /// </summary>
        
        public string LayerCode { get; set; }

        /// <summary>
        /// 级别
        /// </summary>
        
        public int? Levels { get; set; }

        /// <summary>
        /// 机构名字
        /// </summary>
        
        public string Name { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        
        public int? Sort { get; set; }

        /// <summary>
        /// 组织机构类型(1：总部；2：分公司；3：供应商；4：直营门店；5：加盟门店)
        /// </summary>

        public int? Type { get; set; }

        /// <summary>
        ///  父级
        /// </summary>
        public virtual OrganizationDto Parent { get; set; }

        /// <summary>
        ///  子级
        /// </summary>
        public virtual List<OrganizationDto> Children { get; set; }
    }

    /// <summary>
    ///  机构输出体1
    /// </summary>
    public class OrganizationOutputDto1
    {
        /// <summary>
        /// 编码
        /// </summary>
        [JsonProperty("value")]
        public Guid Id { get; set; }

        /// <summary>
        ///  层级
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        ///  机构名字
        /// </summary>
        [JsonProperty("label")]
        public string Name { get; set; }
    }

    /// <summary>
    ///  机构树形输出体
    /// </summary>
    public class OrganizationTreeOutputDto: OrganizationOutputDto1
    {

        /// <summary>
        ///  排序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        ///  层级代码
        /// </summary>
        public string LayerCode { get; set; }

        /// <summary>
        ///  父级编码
        /// </summary>
        public Guid? ParentId { get; set; }


        /// <summary>
        ///  机构类型
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        ///  子集
        /// </summary>
        public List<OrganizationTreeOutputDto> Children { get; set; }
    }
}